#ifndef MATRIX_EXCEPTION_H
#define MATRIX_EXCEPTION_H

#include <exception>
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

using namespace std;

/**
 * Manages the sparse matrix related exception messages.
 * For information on message strings that are used, refer class Constants.
 */
class MatrixException : public exception
{
    char *_msg; /* NON NULL exception message. */

    /**
     *
     * @return constant reference of the message to be displayed.
     */
    virtual const char* what() const throw ();

public:
    /**
     * @param msg the string to display as the message.
     * 
     * @warning msg should not be NULL.
     */
    explicit MatrixException(const char *msg);
    
    /**
     * removes the copy of the error message.
     */
    virtual ~MatrixException() throw ();

};


#endif
